package com.tengju.data.infrastructure.shared;


public enum ResultCodeEnum {

    SUCCESS(0, "成功"),


    /**
     * >0的异常直接显示MESSAGE
     */
    SYS_EXCEPTION(1, "系统异常"),
    PARAMETER_EMPTY(2, "参数为空"),
    ADD_FAIL(3, "新增失败"),
    UPDATE_FAIL(4, "修改失败"),
    DELETE_FAIL(5, "删除失败"),
    PARAMETER_INVALID(6, "参数错误"),
    DATA_EXISTS(7, "数据已存在"),
    DATA_NOTEXISTS(8, "数据不存在"),
    FEIGN_ERROR(9,"调用外部服务错误"),
    TOKEN_ILLEGAL(9001, "未登录授权"),
    UNDEFIND_ERROR(100, "未知错误"),
    SOURCE_NOT_SUPPORT(101, "来源不支持此操作"),
    ILLEGAL_OPERATE(103, "非法操作"),
    
    AUTH_NOT_LOGIN(401, "用户未登录"),
    
    /**
     * 后台系统使用返回码
     */
    DT_LOGIN_ACCOUNT_ERROR(20000, "账号或密码错误"),

    STAR_INVALID(5000,"无效的星级等级"),
    BIZ_ERROR(5001,"业务异常"),

    LOGIN_ERROR(60000, "手机号或密码错误"),
    FROM_ERROR(60001, "来源参数为空"),
    UNBIND_MOBILE(60002, "请绑定手机号"),
    BIND_MOBILE(60003, "已绑定过手机号"),
    USER_DELETE(60004, "该用户已注销"),
    INVITE_CODE_INVALID(60005, "优惠码错误"),
    MOBILE_IS_USED(60006, "手机号已占用"),
    MOBILE_NOT_REG(60007, "手机号未注册"),
    UNBIND_INVITE_CODE(60008, "未绑定邀请码"),
    ALREADY_BIND_INVITE_CODE(60009, "已绑定优惠码,请勿重复操作"),
    BIND_WECHAT(60010, "已绑定微信"),
    WECHAT_USED(60011, "此微信已绑定其他手机号"),
    UNREGISTERED(60012, "未注册用户"),
    CHECK_VERIFY_CODE_ERROR(60013, "验证码错误或已过期"),
    WECHAT_AUTH_FAIL(60014, "微信授权失败"),
    SEND_VERIFY_CODE_FAIL(60015, "验证码发送失败"),
    MOBILE_INVALID(60016, "请输入正确的手机号"),
    BIND_INVITE_CODE_NO_CHANGE(60017, "请勿重复绑定同一邀请码"),
    
    CUSTOM_AUIL_FAIL(60018, "此用户并非您的直属客户，请联系客服处理"),
    
    UNREGISTER_APP_ERROR(60050, "账户注销平台不合法"),
    UNREGISTER_NOT_REACH_CONDITION(60051, "不满足注销条件"),
    UNREGISTER_DUPLICATE(60052, "注销记录已存在,请勿重复提交"),
    WX_APP_SHARER_INVITER_DIFF(60060, "此分享人与邀请人不一致，不可通过此分享购买"),
    WX_APP_LEVEL_RELATION_CHANGE(60061, "您的等级关系发生变化，请去APP购买"),
    WX_APP_INVITER_LESS_LEVEL(60066, "分享人等级不足"),
    /**
     * 分享人和邀请人都是绑定在公司下的用户
     **/
    WX_APP_SHARER_INVITER_IS_COMPANY_USER(60062, "您购买的是升级礼包，请去个人中心修改邀请人后购买"),
    /**
     * 已经修改过一次优惠码
     */
    UPDATE_INVITE_CODE_ALREADY_ONCE(60064, "您已修改过一次优惠码，不可再修改"),
    /**
     * 礼包参团中
     */
    JOIN_GIFT_GROUP(60065, "您有订单正在处理中，此时无法修改"),

    TEMPLATE_NOT_EXIST(70001,"补贴模板不存在"),
    TEMPLATE_RATIO_ERROR(70002,"补贴模板系数错误"),

    SYS_MSG(3280002, "系统升级中。。。。"),

    /**
     * <0 的异常不直接显示给用户
     */
    DATA_ERROR(-1, "数据有误"),
    DATA_NOT_EXIST(-2, "该数据不存在"),
    DB_EXCEPTION(-3, "数据库操作异常"),
    STATUS_EXCEPTION(-4, "状态异常"),
    OPT_EXCEPTION(-5, "执行异常"),
    FUNC_PARAM_NULL(-6, "参数为空"),
    FUNC_PARAM_INVALID(-7, "参数不可用"),

    XXXXX(-10000000, "异常");


    private int code;
    private String msg;

    private ResultCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
